<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>xlfont</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 13/12/2005</div>
    <p>
      <b>xlfont</b> -  load a font in the graphic context or query loaded font</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>xlfont(font-name,font-id)  </tt>
      </dd>
      <dd>
        <tt>fonts=xlfont()  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>font-name</b>
        </tt>: string, name of the font family.</li>
      <li>
        <tt>
          <b>font-id</b>
        </tt>: integer between 0 and 10.</li>
      <li>
        <tt>
          <b>fonts</b>
        </tt>: a column vector of currently loaded font names.</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    Without any argument, <tt>
        <b>xlfont()</b>
      </tt> returns the list of
    currently loaded fonts.
    </p>
    <p>
    With arguments, <tt>
        <b>xlfont</b>
      </tt> is used to load a new font at different sizes 
    in the graphics context. The font must be available with size 8, 10, 12, 14, 18 and 24.
    </p>
    <p>
    Default fonts are "Courier Roman" (0), "Symbol" (1), "Times Roman" 
    (2), "Times Italic" (3), "Times Bold" (4), "Times Bold Italic" 
    (5), "Helvetica" (6), "Helvetica Oblique" (7), "Helvetica Bold" 
    (8), "Helvetica Bold Oblique" (9). These default fonts are automaticaly loaded
    when needed and so <tt>
        <b>xlfont</b>
      </tt> is not really required for them. In fact 
    <tt>
        <b>xlfont</b>
      </tt> is essentially useful to load a new font.
    </p>
    <p>
    font-name can be of 2 types:
    </p>
    <dl>
      <dd>
        <b>-</b> if it contains the character "%", it is supposed to be an  X11 font name 
            with %s in the size field of the name, for example 
            <tt>
          <b>"-b&amp;h-lucidabright-demibold-r-normal--%s-*-75-75-p-*-iso8859-1"</b>
        </tt>
      </dd>
      <dd>
        <b>-</b> if it does not contain the character "%", it is supposed  to be an alias 
            name and the fonts aliased by <tt>
          <b>font-name08,...,font-name24</b>
        </tt> are loaded.
        </dd>
      <dd>
        <b>font-id</b>: give the id <tt>
          <b>font-id</b>
        </tt> to the loaded font <tt>
          <b>font-name</b>
        </tt>.</dd>
    </dl>
    <p>
       Currently this load font feature works only for screen drivers and not for others
       (Postscript, Fig, Gif, PPM). If you export a graphical screen output in Postscript,
       Fig, Gif or PPM while you have previously loaded a new font, the behavior depends of
       the choice of the identifier <tt>
        <b>font-id</b>
      </tt> for the loaded font :
    </p>
    <dl>
      <dd>
        <b>-</b>if <tt>
          <b>font-id=10</b>
        </tt> then the strings (drawn
        with this font) will be drawn with the default font (Times) at the same size;</dd>
      <dd>
        <b>-</b>else the strings will be drawn with the default font
        corresponding to <tt>
          <b>font-id</b>
        </tt>.</dd>
    </dl>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

// Caution : this example may not work if your system have not
//           the schoolbook bold font 
if MSDOS then
   xlfont("Century Schoolbook Bold",10)
else
   xlfont("-adobe-new century schoolbook-bold-r-normal-*-%s-*-75-75-*-*-iso8859-1",10)
end
xset("font", 10, 4) // use Schoolbook bold at 18 pts
plot2d()
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="xset.htm">
        <tt>
          <b>xset</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="getfont.htm">
        <tt>
          <b>getfont</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p>J.Ph.C.  </p>
  </body>
</html>
